<?php
namespace Admin\Controller;
use Think\Controller;

class AdmincateController extends Controller {
    public function index(){
        
    	$cate = M('auth_category')->select();

    	$this->assign('cate',$cate);

        $this->display();
    }

    public function add(){
    	$data = I('post.');
    	/*var_dump($data);exit;*/
    	$result = M('auth_category')->add($data);

    	if($result){
    		$this->ajaxReturn(['error'=>0,'info'=>'添加成功']);
    	}else{
    		$this->ajaxReturn(['error'=>1,'info'=>'添加失败']);
    	}
    }
}

?>